<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>后盾人</title>
  </head>
  <body>
    <style>
      .disable {
        color: #ddd;
      }
    </style>
    <ul>
      <li>hdcms</li>
      <li>houdunren</li>
    </ul>
  </body>
  <script>
    let lis = document.querySelectorAll("ul li");
    lis.forEach(function(item) {
      item.addEventListener("click", function() {
        this.classList.toggle("disable");
      });
    });
    // console.log(lis);
    // console.log([...lis]);
    // let lessons = [
    //   { title: "媒体查询响应式布局", category: "css" },
    //   { title: "FLEX 弹性盒模型", category: "css" },
    //   { title: "MYSQL多表查询随意操作", category: "mysql" }
    // ];
    // lessons.forEach(function(item, index, lessons) {
    //   item.title = item.title.substr(0, 2);
    // });
    // console.table(lessons);
  </script>
</html>
